package edu.mju.responsibility;

import edu.mju.proxy.Man;
import edu.mju.proxy.Person;

public class TestJdkProxyInterceptor {

	public static void main(String[] args) {
		//创建代理类对象
		JdkDynamicInterceptorProxy jdkDynamicInterceptorProxy = new JdkDynamicInterceptorProxy();
		//反射生成代理对象
		Person proxyMan1 = (Person) jdkDynamicInterceptorProxy.proxyRelation(new Man(),"edu.mju.responsibility.interceptor.Interceptor1");
		Person proxyMan2 = (Person) jdkDynamicInterceptorProxy.proxyRelation(proxyMan1,"edu.mju.responsibility.interceptor.Interceptor2");
		Person proxyMan3 = (Person) jdkDynamicInterceptorProxy.proxyRelation(proxyMan2,"edu.mju.responsibility.interceptor.Interceptor3");

		proxyMan3.run();
	}

}
